Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-3.8] Avoid to exit while trying to install a specific kernel-devel version #2603

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

enrico-usai
Copy link
Contributor

@enrico-usai enrico-usai commented Dec 14, 2023

Description of changes

Avoid to exit while trying to install a specific kernel-devel version

This code has been created to try to install using --releasever parameter and if this command fails try to install the package from vault, anyway the set -e at the top of the failing was causing all the build to fail.

Fix kernel-devel package name for rhel8

When using wget, the package name must contain the architecture too.
By redefining the kernel_source_package_version we're avoiding to chomp the architecture from kernel version.
Then, use node['kernel']['machine'] rather than uname -m.

Tests

  • Manually tested in a Rocky-8-EC2-Base-8.8-20230518.0.x86_64
  • Verified that both dnf install and wget commands are working when passing architecture.

References

This code has been created to try to install using `--releasever` parameter
and if this command fails try to install the package from vault,
anyway the `set -e` at the top of the failing was causing all the build to fail.

Manually tested in a Rocky-8-EC2-Base-8.8-20230518.0.x86_64

Related to: aws#2598

Signed-off-by: Enrico Usai <[email protected]>
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8b869b5) 75.56% compared to head (2d90eaa) 75.56%.

❗ Current head 2d90eaa differs from pull request most recent head 66fa22c. Consider uploading reports for the commit 66fa22c to get more accurate results

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #2603   +/-   ##
========================================
  Coverage    75.56%   75.56%           
========================================
  Files           16       16           
  Lines         2132     2132           
========================================
  Hits          1611     1611           
  Misses         521      521           
Flag Coverage Δ
unittests 75.56% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@enrico-usai enrico-usai enabled auto-merge (rebase) December 14, 2023 11:53
When using `wget`, the package name must contain the architecture too.
By redefining the `kernel_source_package_version` we're avoiding to `chomp` the architecture from kernel version.

Then, use `node['kernel']['machine']` rather than `uname -m`.

### Tests

Verified that both `dnf install` and `wget` commands are working when passing architecture.

### References

* https://github.com/chef/ohai/blob/17-stable/lib/ohai/plugins/kernel.rb#L34

Signed-off-by: Enrico Usai <[email protected]>
@enrico-usai enrico-usai disabled auto-merge December 14, 2023 14:45
@enrico-usai enrico-usai enabled auto-merge (rebase) December 14, 2023 14:46
@enrico-usai enrico-usai merged commit 8d2bb6d into aws:develop Dec 14, 2023
26 checks passed
@enrico-usai enrico-usai deleted the wip/rocky-kernel branch December 14, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants